<!-- TEMPLATE ANIMAL RECHERCHER -->

<section id="content">


<h1 class="article">{#ANIMAL_RECHERCHER#}</h1>

<form name="formulaire" action="?action=rechercherAnimal" method="post" class="article buttons">
    
    <fieldset class="form-text">
        <label>{#NOM#}</label>
        <input type="text" name="nom" id="nom" class="validate[optional,custom[onlyLetter],length[0,12]] text-input"/>
    </fieldset>
    <fieldset class="form-text">
        <label>{#DEUXIEME_NOM#}</label>
        <input type="text" name="secondNom" id="secondNom" class="validate[optional,custom[onlyLetter],length[0,12]] text-input" />
    </fieldset>
    <fieldset>
       	<label>{#SEXE#}</label>
        <select name="sexe" id="sexe" class="validate[optional]">
        	<option value="null">---</option>
        	<option value="Male">{#MALE#}</option>
            <option value="Femelle">{#FEMELLE#}</option>
            <option value="Indetermine">{#INDETERMINE#} </option>
    	</select>
    </fieldset> 
 <fieldset>
 	<label>{#TYPE_ANIMAL#}</label>
    <select name="TypeAnimal" onchange="{literal}showRaces(this.value){/literal}">
    	<option value="null">---</option>
        {section name="unType" loop=$typeAnimal}
        <option value={$typeAnimal[unType]->getNom()}>{$typeAnimal[unType]->getNom()}</option>
        {/section}
        </select>
 </fieldset>
 <fieldset>
 	<label>{#COULEUR#}</label>
    	<select name="couleur">
        <option value="null">---</option>
        {html_options output=$listeCouleur values=$listeCouleur selected=$couleurSelected}
        </select>
</fieldset>  
<fieldset>
	<label>{#RACE#}</label>
    <select name="TypeRace" id="txtHint">
        <option value="null">---</option>
    </select>         
</fieldset>

<fieldset class="form-actions">
    <input type="submit" class="submit" name="rechercherAnimal" value="{#RECHERCHER#}" />
</fieldset>
    
</form>

    
<h2 class="article">{#RESULTAT_RECHERCHE#}</h2>
   

	 <table class="article" id="tableauRecherche">
        <thead>
            <tr>
                <th id="animalRechercheID" width="20">{#ID#}</th>
                <th id="animalRechercheNom" width="70">{#NOM#}</th>
                <th id="animalRechercheDeuxNom" width="100"> {#DEUXIEME_NOM#}</th>
                <th id="animalRechercheType" width="100">{#TYPE_ANIMAL#}</th>
                <th id="animalRechercheSexe" width="70">{#SEXE#}</th>
                <th id="animalRechercheAction" width="50px"> </th>
                {if (isset($groupe)) && ($groupe eq 'Super Administrateurs')}
                <th></th>
                {/if}
            </tr> 
        </thead>
        <tbody>
            {if isset($listeAnimaux)}
                {foreach from=$listeAnimaux item=record }
                    <tr class="{cycle values="ligne1,ligne2"}">
                        <td><a href ="?action=afficherAnimal&id={$record->getId()}">{$record->getId()}</a></td>
                        <td>{$record->getNom()}</td>
                        <td>{$record->getSecondNom()}</td>
                        <td>{$record->getTypeDeRace_nom()}</td>
                        <td>{$record->getSexe()}</td>
                        {if (isset($groupe)) && ($groupe eq 'Super Administrateurs')}
                        <td><a href="?action=afficherSupprimerAnimal&id={$record->getId()}">{#SUPPRIMER#}</a></td>
                        {/if}
                    </tr>
                {/foreach}    
            {/if}     
        </tbody>  

</div>

</section>
